package com.sbtr.validate;

import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 验证字符串非空白 <br>
 * 执行器
 *
 * @author qiujun
 * @date 2019-11-05
 */
public class NotBlankValidator implements ConstraintValidator<NotBlank, String> {


    /*
     * （非 Javadoc）
     *
     * @see javax.validation.ConstraintValidator#isValid(java.lang.Object, javax.validation.ConstraintValidatorContext)
     */
    public boolean isValid(String string, ConstraintValidatorContext constraintValidatorContext) {
        return StringUtils.isNotBlank(string);
    }

}

